//////////////////////// Home start///////////////////////////////////
function validateForm() {

	var uname = document.forms["loginform"]["username"].value;
	var password = document.forms["loginform"]["password"].value;
	if (uname == null || uname == "") {
		alert("User name must be filled out");
		return false;
	}
	if (password == null || password == "") {
		alert("Password must be filled out");
		return false;		
	}
	if (uname !='Admin'){
		$('#errorMessage').text("Please Enter correct Username");
		return false;		
	}
	if (password !='Admin'){
		$('#errorMessage').text("Please Enter correct Password");
		return false;		
	}
}
// ////////////////////// Home end/////////////////////////////////////

// ////////////////////// ctzchart start///////////////////////////////////

function validatectzchart() {
	//alert("11111111111");
	try {
		var yearSel = $('select#THE_YEAR option:selected').val();
		var stateSel = $('select#STATE option:selected').val();
		
		//console.log('yearSel'+yearSel);
		//console.log('stateSel'+stateSel);
		if (yearSel == 'select' || yearSel == null) {
			//alert("Please select YEAR");
			return false;
		}

		if (stateSel == 'select' || stateSel == null) {
			//alert("Please select STATE");
			return false;
		}		
	} catch (e) {
		
	}
	return true;	
}


function inputvalidatationBeforeReport() {	
	try {
		//alert("Enter into inputvalidatationBeforeReport");
		var yearSel = $('select#THE_YEAR option:selected').val();
		//var stateSel = $('select#STATE option:selected').val();
		
		//console.log('yearSel'+yearSel);
		//console.log('stateSel'+stateSel);
		if (yearSel == 'select' || yearSel == null) {
			//alert("Please select YEAR");
			return false;
		}

		/*if (stateSel == 'select' || stateSel == null) {
			alert("Please select STATE");
			return false;
		}	*/	
	} catch (e) {
		
	}
	return true;	
}

// ////////////////////// ctzchart end/////////////////////////////////////

// ////////////////////// cmpchart start/////////////////////////////////////

function validatecmpchart() {
	var yearSelTo = $('select#THE_YEAR_TO option:selected').val();
	var yearSelFrm = $('select#THE_YEAR_FROM option:selected').val();
	var stateSel = $('select#STATE option:selected').val();

	if (yearSelFrm == 'select' || yearSelFrm == null) {
		if (stateSel == 'select' || stateSel == null) {
			//alert("Please select YEAR_FROM & STATE");
			return false;
		} else if (yearSelTo == 'select' || yearSelTo == null) {
			//alert("Please select YEAR_FROM & YEAR_TO");
			return false;
		} else {
			//alert("Please select YEAR_FROM");
			return false;
		}	
	}
	
	if (yearSelTo == 'select' || yearSelTo == null) {
		if (stateSel == 'select' || stateSel == null) {
			//alert("Please select YEAR_TO & STATE");
			return false;
		} else if (yearSelFrm == 'select' || yearSelFrm == null) {
			//alert("Please select YEAR_FROM & YEAR_TO");
			return false;
		} else {
			//alert("Please select YEAR_TO");
			return false;
		}		
	} 

	if (stateSel == 'select' || stateSel == null) {
		//alert("Please select STATE");
		return false;
	}

	return true;
}

// ////////////////////// cmpchart end///////////////////////////////////////